package com.magina.project.controller;

import com.magina.project.entity.SysLog;
import com.magina.project.repository.JpaDemoEntityRepo;
import com.magina.project.repository.SysLogMapper;
import com.magina.project.repository.SysLogRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDateTime;
import java.util.List;
import java.util.UUID;


@RestController
@RequestMapping("/demo")
public class JpaDemoController {


    @Autowired
    private JpaDemoEntityRepo jpaDemoEntityRepo;

    @GetMapping("/deleteBySoft1")
    public void deleteBySoft1(String id ){
        //测试自定义逻辑删除
        jpaDemoEntityRepo.deleteById(id);
    }

    @GetMapping("/deleteBySoft2")
    public void deleteBySoft2(String id ){
        //测试自定义逻辑删除
        jpaDemoEntityRepo.softDeleteById(id);
    }


    @GetMapping("/findNoDel")
    public Object findNoDel( ){
        //测试自定义逻辑删除
        return jpaDemoEntityRepo.findAll();
    }


}
